package com.homework.ch01;

import java.lang.reflect.Constructor;

/**
 * @author yang
 * @date 2024-03-26
 */
public class Test01 {
    public static void main(String[] args) throws Exception{
        Class<?> clazz = TestStudent01.class;
        Constructor constructor = clazz.getConstructor(String.class,int.class,Double.class);
        Object obj = constructor.newInstance("张三", 20, 75D);
        if (obj instanceof TestStudent01){
            ((TestStudent01) obj).show();
        }
    }
}
